<%@ page language="java" pageEncoding="UTF-8"%>
<div class="modal-body">
  <form id="user-form" name="user-form" class="form-horizontal">
		<input type="hidden" name="id" id="knowledgeId">
		<input type="hidden" name="createTime" data-flag="date" data-format="yyyy-MM-dd HH:mm:ss">
		<input type="hidden" name="deleted">
		<div class="box-body">
			<div class="col-md-12">
				<div class="form-group">
					<label for="title" class="col-sm-1 control-label">标题</label>
					<div class="col-sm-10">
						<input type="text" class="form-control" id="title" name="title" placeholder="标题" disabled>
					</div>
				</div>
				<div class="form-group">
					<label for="type" class="col-sm-1 control-label">类别</label>
					<div class="col-sm-6">
						<input type="text" class="form-control" id="type" name="type" placeholder="类别" disabled>
					</div>
				</div>
			</div>
		</div>
	</form>
  <div id="container" style="margin-top:100px; margin-bottom:10px"></div>
  <div class="box-footer text-right">
	<!--以下两种方式提交验证,根据所需选择-->
	<button type="button" class="btn btn-default" data-btn-type="cancel" onclick="dialog_close()">取消</button>
</div>
</div>
<script type="text/javascript">
  var id = "";
  $(document).ready(function(){
    // editor准备好之后才可以使用
    if( Dtable_knowledge.rows('.selected').data()[0] ){
    	id = Dtable_knowledge.rows('.selected').data()[0].id;
    	if( id != null && id != ""){
    		var url = "../../tbl_knowledge_base/" + id;		
        	$.ajax({
      		  url: url,
      		  type : 'get',
      		  async : false,
      		  contentType: "application/json; charset=utf-8",
      		  dataType: "json",
      		  success: function(json) {
      			  console.log(json);
      			  $("#title").val( json.data.title );
      			  $("#type").val( json.data.type );
      			  $("#container").html(json.data.html);
      		  }
      		});
        }
    }
  });

  function dialog_close(){
		global.dialog.close()
	}
</script>
</html>
